<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>卡券管理</title>
    <link href="{:C('WEB_URL')}Public/admin/style/base.css" rel="stylesheet" type="text/css" />
    <link href="{:C('WEB_URL')}Public/admin/style/master.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="{:C('WEB_URL')}Public/admin/js/jquery1.9.1.js"></script>
    <script type="text/javascript" src="{:C('WEB_URL')}Public/admin/js/base.js"></script>
    <script>
        function del(id){
            if(confirm('确定要删除记录吗?')){
                var url="__URL__/del/coupon_id/"+id;
               // alert(url);
				$.getJSON(url,function(data){
                    if(data['status']==1){
                        $(".list > tbody").children("#J_list"+data['data']).remove();
                    }else{
                        alert(data['info']);
                    }
                })
            }
        }
    </script>
	<style type="text/css">
	.box-info{position:absolute;top:0px;bottom:0;right:0px;left:0px;border:1px solid red;background-color:rgba(144,144,145,0.5);display:none}
	.UE img{height:30px;};
	</style>
</head>
<body>
<body>
    <div id="wrapper">
        <h2>卡券管理<a href="{:U('edit')}" class="but_add">添加</a></h2>
        <table class="list">
            <thead>
			<!--筛选-->
		<form action="{:U('index')}" method="post" enctype="multipart/form-data">
        
			卡券名称:<input type='text' class='inputText' name='coupon_name' value="{$_REQUEST['coupon_name']}"/>
			
			<input type='submit' value='搜索' class='btnOrange'>
		</form>
                <tr>
					<th>卡券ID</th>
					<th>卡券名称</th>
					<th>商场名称</th>
					<th>卡券logo</th>
                    <th>卡券二维码</th>
                    <th>原价</th>
					<th>每次节省</th> 
                    <th>卡券次数</th> 
					<th>折扣价</th>
					<th>操作</th>
                </tr>
            </thead>
            <tbody>
            <volist name='list' id='vo'>
                <tr align="center" id="J_list{$vo['coupon_id']}">
                    <td>{$vo['coupon_id']}</td>
                    <td>{$vo['coupon_name']}</td>
                    <td>{$vo['business_name']}</td>
                    <td><?php if($vo['small_logo']){ ?><img src ="{:C('WEB_URL')}{$vo['small_logo']}" style="width:40px;" ><?php }else{ echo '暂无';}?></td>
                     <td><?php if($vo['erwei']){ ?><a href="{:C('WEB_URL')}{$vo['erwei']}" download="{$vo['coupon_id']}"><img src ="{:C('WEB_URL')}{$vo['erwei']}" style="width:40px;" ></a><?php }else{ echo '暂无';}?></td>
                    <td>{$vo['price']}</td>
                    <td>{$vo['old_price']}</td>
                    <td>{$vo['count']}</td>
                    <td>{$vo['new_price']}</td>
                    <td>
                  
                  <!-- 1.审核中2 已审核通过 3驳回 4禁用 -->
                  
                     <?php if($vo['status']==1){echo "审核中";}?>
                    
                           <?php if($vo['status']==2    ){echo "审核通过";}?>

                           
                             <?php if($vo['status']==4){echo "已禁用";}?>
                                 <a href="{:U('edit',array('coupon_id'=>$vo['coupon_id'] , 'nowPage'  =>$nowPage  ))}" class="edit" >编辑</a>
                                 
                                 <span class="del" onClick="del({$vo['coupon_id']})">删除</span>

                    </td > 	
                    
                   
                           
                        
                </tr>
            </volist>
            </tbody>
        </table>
        <p class="hr_10"></p>
        <div class="pages">{$page} </div>
    </div>
	
	<div class='box-info'>
	</div>
<script type="text/javascript">
	  $(document).on("click","a.J_itemDel",function(){
                $(this).parent("li").remove();
            })
</script>
</body>
</html>